<?php
require_once(dirname(__FILE__). '/include/application.php');
date_default_timezone_set('Asia/Tokyo');
/* process currefer*/
$currefer = uencode(strval($_SERVER['REQUEST_URI']));

/* session,cache,configure,webroot register */
Session::Init();
$INI = ZSystem::GetINI();
$AJAX = ('XMLHttpRequest' == @$_SERVER['HTTP_X_REQUESTED_WITH']);
if (false==$AJAX) { 
    header('Content-Type: text/html; charset=UTF-8;'); 
} else {
    header("Cache-Control: no-store, no-cache, must-revalidate");
}
/* end */

/* biz logic */
$login_user_id = MLogin::GetLoginId();
$login_user = Users::GetUser($login_user_id);
$oauthMap = OauthLimit::getOauthMap($login_user_id);

$defaultShopId = 0;

$defaultShopId = abs( intval( $_GET['shop_id'] ) );
$shopList = Shop::GetAllShops();

$webRoot = WEB_ROOT;
//Logs::setLog("web_root[app]||=".$webRoot);

/* not allow access app.php */
if($_SERVER['SCRIPT_FILENAME']==__FILE__){
	redirect( WEB_ROOT . '/index.php');
}

$yearList = array();
for($tempYear = date('Y'), $index = 0; $index < 3; $index++){
	array_push($yearList, $tempYear - $index);
}
$monthList = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
$dayList = array();
for($index = 1; $index <= 31; $index++){
	array_push($dayList, $index);
}

/* end */